package boot;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2023-03-16 11:47
 */
@SpringbootApplication
@ComponentScan("boot")
public class Run {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
		// 注册 Configuration Class
		context.register(Run.class);
		// 启动 Spring 应用上下文
		context.refresh();
		//
		Object init = context.getBean("init");
		System.out.println(init);
		//关闭上下文
		context.close();
	}
}
